//
// Created by sai on 2019/4/16.
//

#ifndef BUCKETSORT_BUCKETSORT_H
#define BUCKETSORT_BUCKETSORT_H

#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
struct Node;
typedef int ElemType;
typedef struct Node *PtrToPostion;
typedef PtrToPostion Position;
typedef Position List;
typedef Position Bucket[];

void InitialBuckets(Bucket buckets, int size);

void GenerateList(List list, int size);

void BucketSort(List list);

bool isLast(Position node);

bool isEmpty(List list);

List makeEmpty();

Position find(ElemType data, List list);

Position findPrevious(ElemType data, List list);

bool InsertNode(ElemType data, List list, Position pos);

bool DeleteNode(ElemType data, List list);

void DeleteList(List list);

void appendNode(ElemType data, List list);

void PrintBuckets(List list);

struct Node {
    ElemType data;
    Position next;
};
#endif //BUCKETSORT_BUCKETSORT_H
